﻿#region zh-CHS 2006 - 2007 DemoSoft 团队 | en 2006 - 2007 DemoSoft Team

//     NOTES
// ---------------
//
// This file is a part of the MMOSE(Massively Multiplayer Online Server Engine) for .NET.
//
//                              2006-2007 DemoSoft Team
//
//
// First Version : by H.Q.Cai - mailto:caihuanqing@hotmail.com
// 
// optimize BaseMap : Thank DanielChen

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

#region zh-CHS 包含名字空间 | en Include namespace
using System;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using Demo.Mmose.Core.Util;
using Demo.Mmose.Core.Item;
using Demo.Mmose.Core.World;
using Demo.Mmose.Core.Common;
using Demo.Mmose.Core.Network;
using Demo.Mmose.Core.Creature;
using Demo.Mmose.Core.Character;
using Demo.Mmose.Core.Common.SupportSlice;
#endregion

// 可移动的物体
// 可视
// 更新血
// 移动
// 攻击
// 给出经验和道具
// 给出是否升级
// 检测是否上面已经更新则发送相应的数据包

// 道具的物体
// 清除已无效的掉落道具
// 可视
// 装备上
// 道具状态改变

// 地图
// 所有的道具
// 所有的人物

// 地图 -> 人物&道具

namespace Demo.Mmose.Core.Map
{
    // 地图的信息
    //////////////////////////////////////////////////////////////////////////
    // 给出某个坐标点范围内的数据(Mobile/Item/Client)
    // 
    // 
    // 
    // 
    // 
    // 
    // 

    /// <summary>
    /// 
    /// </summary>
    public class BaseMap : IComparable, IComparable<BaseMap>, ISupportSlice
    {
        #region zh-CHS 私有常量 | en Private Constants
        /// <summary>
        /// 
        /// </summary>
        internal const int LIST_CAPACITY_SIZE = 20;
        #endregion

        #region zh-CHS 构造和初始化和清理 | en Constructors and Initializers and Dispose
        /// <summary>
        /// 
        /// </summary>
        public BaseMap()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mapID"></param>
        /// <param name="mapIndex"></param>
        /// <param name="fileIndex"></param>
        /// <param name="iWidth"></param>
        /// <param name="iHeight"></param>
        /// <param name="iSeason"></param>
        /// <param name="strName"></param>
        /// <param name="mapRules"></param>
        public BaseMap( Serial mapId, Rectangle3D mapRectangle, string strMapName )
        {
            m_MapId = mapId;
            m_MapRectangle = mapRectangle;
            m_MapName = strMapName;
        }
        #endregion

        #region zh-CHS 共有属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        Rectangle3D m_MapRectangle = new Rectangle3D();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public Rectangle3D MapRectangle
        {
            get { return m_MapRectangle; }
            set { m_MapRectangle = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private Serial m_MapId;
        #endregion
        /// <summary>
        /// 地图的ID
        /// </summary>
        public Serial MapId
        {
            get { return m_MapId; }
            set { m_MapId = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 地图名
        /// </summary>
        private string m_MapName;
        #endregion
        /// <summary>
        /// 地图名
        /// </summary>
        public string MapName
        {
            get { return m_MapName; }
            set { m_MapName = value; }
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 地图的全部地图点的数据
        /// </summary>
        private MapSpaceNode[, ,] m_SpaceNodes = null;
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public MapSpaceNode[, ,] SpaceNodes
        {
            get { return m_SpaceNodes; }
        }

        #region zh-CHS BaseWorld属性 | en BaseWorld Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 管理当前的世界服务
        /// </summary>
        private BaseWorld m_BaseWorld = null;
        #endregion
        /// <summary>
        /// 管理当前的世界服务
        /// </summary>
        public BaseWorld BaseWorld
        {
            get { return m_BaseWorld; }
            internal set { m_BaseWorld = value; }
        }

        #endregion

        #endregion

        #region zh-CHS 方法 | en Method

        #region zh-CHS 分割地图内的区域点 | en
        /// <summary>
        /// 
        /// </summary>
        public virtual void ProcessPartitionSpace( IPartitionSpace partitionSpace )
        {
            if ( partitionSpace == null )
            {
                Debug.WriteLine( "BaseMap.ProcessPartitionSpace(...) - partitionSpace == null error!" );
                return;
            }

            this.ThreadPartitionSpace += new EventHandler<PartitionSpaceEventArgs>( partitionSpace.ProcessPartitionSpace );
            this.ThreadGetSpaceNode += new EventHandler<GetSpaceNodeEventArgs>( partitionSpace.GetSpaceNod );
            this.ThreadGetSpaceNodesInRange += new EventHandler<GetGetSpaceNodesInRangeEventArgs>( partitionSpace.GetSpaceNodesInRange );
            this.ThreadActivateSpaceNode += new EventHandler<ActivateSpaceNodeOnMapEventArgs>( partitionSpace.ActivateSpaceNodeOnMap );
            this.ThreadDeactivateSpaceNode += new EventHandler<DeactivateSpaceNodeOnMapEventArgs>( partitionSpace.DeactivateSpaceNodeOnMap );

            EventHandler<PartitionSpaceEventArgs> tempEventArgs = m_ThreadEventPartitionSpace;
            if ( tempEventArgs != null )
            {
                PartitionSpaceEventArgs eventArgs = new PartitionSpaceEventArgs( this );
                tempEventArgs( this, eventArgs );

                if ( eventArgs.PartitionSpace == null )
                {
                    Debug.WriteLine( "BaseMap.ProcessPartitionSpace(...) - eventArgs.PartitionSpace == null error!" );
                    return;
                }
                else
                    m_SpaceNodes = eventArgs.PartitionSpace;

                for ( int iIndex0 = 0; iIndex0 < m_SpaceNodes.GetLength( 0 ); iIndex0++ )
                {
                    for ( int iIndex1 = 0; iIndex1 < m_SpaceNodes.GetLength( 1 ); iIndex1++ )
                    {
                        for ( int iIndex2 = 0; iIndex2 < m_SpaceNodes.GetLength( 2 ); iIndex2++ )
                        {
                            if ( eventArgs.PartitionSpace[iIndex0, iIndex1, iIndex2] != null )
                            {
                                m_SpaceNodes[iIndex0, iIndex1, iIndex2].RankIndex.Rank0Index = iIndex0;
                                m_SpaceNodes[iIndex0, iIndex1, iIndex2].RankIndex.Rank1Index = iIndex1;
                                m_SpaceNodes[iIndex0, iIndex1, iIndex2].RankIndex.Rank2Index = iIndex2;

                                m_SpaceNodes[iIndex0, iIndex1, iIndex2].Owner = this;

                                m_SpaceNodes[iIndex0, iIndex1, iIndex2].ProcessPartitionSpace( partitionSpace );
                            }
                        }
                    }
                }
            }
        }
        #endregion

        #region zh-CHS 给出坐标获取地图内的某个区域点 | en
        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public MapSpaceNode GetSpaceNode( Point2D point2D )
        {
            return GetSpaceNode( point2D.X, point2D.Y, 0 );
        }

        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public MapSpaceNode GetSpaceNode( IPoint2D point2D )
        {
            return GetSpaceNode( point2D.X, point2D.Y, 0 );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public MapSpaceNode GetSpaceNode( float x, float y )
        {
            return GetSpaceNode( x, y, 0 );
        }

        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point3D"></param>
        /// <returns></returns>
        public MapSpaceNode GetSpaceNode( Point3D point3D )
        {
            return GetSpaceNode( point3D.X, point3D.Y, point3D.Z );
        }

        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public MapSpaceNode GetSpaceNode( IPoint3D point3D )
        {
            return GetSpaceNode( point3D.X, point3D.Y, point3D.Z );
        }

        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public MapSpaceNode GetSpaceNode( float x, float y, float z )
        {
            EventHandler<GetSpaceNodeEventArgs> tempEventArgs = m_ThreadEventGetSpaceNode;
            if ( tempEventArgs != null )
            {
                GetSpaceNodeEventArgs eventArgs = new GetSpaceNodeEventArgs( x, y, z, this );
                tempEventArgs( this, eventArgs );

                return eventArgs.SpaceNode;
            }

            return null;
        }
        #endregion

        #region zh-CHS 给出坐标范围获取地图内的多个区域点 | en
        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public MapSpaceNode[] GetSpaceNodesInRange( Point2D point2D, float fRange )
        {
            return GetSpaceNodesInRange( point2D.X, point2D.Y, 0, fRange );
        }

        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public MapSpaceNode[] GetSpaceNodesInRange( IPoint2D point2D, float fRange )
        {
            return GetSpaceNodesInRange( point2D.X, point2D.Y, 0, fRange );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public MapSpaceNode[] GetSpaceNodesInRange( float x, float y, float fRange )
        {
            return GetSpaceNodesInRange( x, y, 0, fRange );
        }

        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point3D"></param>
        /// <returns></returns>
        public MapSpaceNode[] GetSpaceNodesInRange( Point3D point3D, float fRange )
        {
            return GetSpaceNodesInRange( point3D.X, point3D.Y, point3D.Z, fRange );
        }

        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public MapSpaceNode[] GetSpaceNodesInRange( IPoint3D point3D, float fRange )
        {
            return GetSpaceNodesInRange( point3D.X, point3D.Y, point3D.Z, fRange );
        }

        #region zh-CHS 私有静态成员变量 | en Private Static Member Variables
        /// <summary>
        /// 
        /// </summary>
        private static MapSpaceNode[] s_NullSpaceNodeArray = new MapSpaceNode[0];
        #endregion
        /// <summary>
        /// 给出x,y点的地图该点的数据
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public MapSpaceNode[] GetSpaceNodesInRange( float x, float y, float z, float fRange )
        {
            EventHandler<GetGetSpaceNodesInRangeEventArgs> tempEventArgs = m_ThreadEventGetSpaceNodesInRange;
            if ( tempEventArgs != null )
            {
                GetGetSpaceNodesInRangeEventArgs eventArgs = new GetGetSpaceNodesInRangeEventArgs( x, y, z, Math.Abs( fRange ), this );
                tempEventArgs( this, eventArgs );

                return eventArgs.SpaceNodes;
            }

            return s_NullSpaceNodeArray;
        }
        #endregion

        #region zh-CHS 进入或离开地图区域点 | en

        /// <summary>
        /// 道具进入新的地图区域点
        /// </summary>
        /// <param name="item"></param>
        public bool OnEnter( BaseItem baseItem )
        {
            EventHandler<BeforeItemEnterMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeItemEnterMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeItemEnterMapEventArgs eventArgs = new BeforeItemEnterMapEventArgs( baseItem, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode mapSpaceNode = GetSpaceNode( baseItem );
            if ( mapSpaceNode == null )
                return false;
            else
            {
                if ( mapSpaceNode != baseItem.MapSpaceNode )
                {
                    mapSpaceNode.OnEnter( baseItem );
                    baseItem.MapSpaceNode = mapSpaceNode;
                }
            }

            EventHandler<AfterItemEnterMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterItemEnterMap;
            if ( tempAfterEventArgs != null )
            {
                AfterItemEnterMapEventArgs eventArgs = new AfterItemEnterMapEventArgs( baseItem, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 人物进入新的地图区域点
        /// </summary>
        /// <param name="m"></param>
        public bool OnEnter( BaseCreature baseCreature )
        {
            EventHandler<BeforeCreatureEnterMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeCreatureEnterMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeCreatureEnterMapEventArgs eventArgs = new BeforeCreatureEnterMapEventArgs( baseCreature, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode mapSpaceNode = GetSpaceNode( baseCreature );
            if ( mapSpaceNode == null )
                return false;
            else
            {
                if ( mapSpaceNode != baseCreature.MapSpaceNode )
                {
                    mapSpaceNode.OnEnter( baseCreature );
                    baseCreature.MapSpaceNode = mapSpaceNode;
                }
            }

            EventHandler<AfterCreatureEnterMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterCreatureEnterMap;
            if ( tempAfterEventArgs != null )
            {
                AfterCreatureEnterMapEventArgs eventArgs = new AfterCreatureEnterMapEventArgs( baseCreature, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 人物进入新的地图区域点
        /// </summary>
        /// <param name="m"></param>
        public bool OnEnter( BaseCharacter baseCharacter )
        {
            EventHandler<BeforeCharacterEnterMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeCharacterEnterMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeCharacterEnterMapEventArgs eventArgs = new BeforeCharacterEnterMapEventArgs( baseCharacter, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode mapSpaceNode = GetSpaceNode( baseCharacter );
            if ( mapSpaceNode == null )
                return false;
            else
            {
                if ( mapSpaceNode != baseCharacter.MapSpaceNode )
                {
                    mapSpaceNode.OnEnter( baseCharacter );
                    baseCharacter.MapSpaceNode = mapSpaceNode;
                }
            }

            EventHandler<AfterCharacterEnterMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterCharacterEnterMap;
            if ( tempAfterEventArgs != null )
            {
                AfterCharacterEnterMapEventArgs eventArgs = new AfterCharacterEnterMapEventArgs( baseCharacter, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 道具离开新的地图区域点
        /// </summary>
        /// <param name="item"></param>
        public bool OnLeave( BaseItem baseItem )
        {
            EventHandler<BeforeItemLeaveMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeItemLeaveMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeItemLeaveMapEventArgs eventArgs = new BeforeItemLeaveMapEventArgs( baseItem, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode mapSpaceNode = GetSpaceNode( baseItem );
            if ( mapSpaceNode == null )
                return false;
            else
            {
                if ( mapSpaceNode != baseItem.MapSpaceNode )
                {
                    mapSpaceNode.OnLeave( baseItem );
                    baseItem.MapSpaceNode = null;
                }
            }

            EventHandler<AfterItemLeaveMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterItemLeaveMap;
            if ( tempAfterEventArgs != null )
            {
                AfterItemLeaveMapEventArgs eventArgs = new AfterItemLeaveMapEventArgs( baseItem, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 人物离开新的地图区域点
        /// </summary>
        /// <param name="m"></param>
        public bool OnLeave( BaseCreature baseCreature )
        {
            EventHandler<BeforeCreatureLeaveMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeCreatureLeaveMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeCreatureLeaveMapEventArgs eventArgs = new BeforeCreatureLeaveMapEventArgs( baseCreature, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode mapSpaceNode = GetSpaceNode( baseCreature );
            if ( mapSpaceNode == null )
                return false;
            else
            {
                if ( mapSpaceNode != baseCreature.MapSpaceNode )
                {
                    mapSpaceNode.OnLeave( baseCreature );
                    baseCreature.MapSpaceNode = null;
                }
            }

            EventHandler<AfterCreatureLeaveMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterCreatureLeaveMap;
            if ( tempAfterEventArgs != null )
            {
                AfterCreatureLeaveMapEventArgs eventArgs = new AfterCreatureLeaveMapEventArgs( baseCreature, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 人物离开新的地图区域点
        /// </summary>
        /// <param name="m"></param>
        public bool OnLeave( BaseCharacter baseCharacter )
        {
            EventHandler<BeforeCharacterLeaveMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeCharacterLeaveMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeCharacterLeaveMapEventArgs eventArgs = new BeforeCharacterLeaveMapEventArgs( baseCharacter, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }


            MapSpaceNode mapSpaceNode = GetSpaceNode( baseCharacter );
            if ( mapSpaceNode == null )
                return false;
            else
            {
                if ( mapSpaceNode != baseCharacter.MapSpaceNode )
                {
                    mapSpaceNode.OnLeave( baseCharacter );
                    baseCharacter.MapSpaceNode = null;
                }
            }

            EventHandler<AfterCharacterLeaveMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterCharacterLeaveMap;
            if ( tempAfterEventArgs != null )
            {
                AfterCharacterLeaveMapEventArgs eventArgs = new AfterCharacterLeaveMapEventArgs( baseCharacter, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 道具移动到旧的地图区域点, 并离开新的地图区域点
        /// </summary>
        /// <param name="oldLocation"></param>
        /// <param name="item"></param>
        public bool OnMove( Point3D oldLocation, BaseItem baseItem )
        {
            EventHandler<BeforeItemMoveInMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeItemMoveInMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeItemMoveInMapEventArgs eventArgs = new BeforeItemMoveInMapEventArgs( oldLocation, baseItem, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode oldMapSpaceNode = GetSpaceNode( oldLocation );
            if ( oldMapSpaceNode == null )
                return false;

            MapSpaceNode newMapSpaceNode = GetSpaceNode( baseItem.Location );
            if ( newMapSpaceNode == null )
                return false;

            if ( oldMapSpaceNode != newMapSpaceNode )
            {
                oldMapSpaceNode.OnLeave( baseItem );
                baseItem.MapSpaceNode = null;

                newMapSpaceNode.OnEnter( baseItem );
                baseItem.MapSpaceNode = newMapSpaceNode;
            }

            EventHandler<AfterItemMoveInMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterItemMoveInMap;
            if ( tempAfterEventArgs != null )
            {
                AfterItemMoveInMapEventArgs eventArgs = new AfterItemMoveInMapEventArgs( oldLocation, baseItem, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 人物移动到新的地图区域点, 并离开旧的地图区域点
        /// </summary>
        /// <param name="oldLocation"></param>
        /// <param name="m"></param>
        public bool OnMove( Point3D oldLocation, BaseCreature baseCreature )
        {
            EventHandler<BeforeCreatureMoveInMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeCreatureMoveInMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeCreatureMoveInMapEventArgs eventArgs = new BeforeCreatureMoveInMapEventArgs( oldLocation, baseCreature, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode oldMapSpaceNode = GetSpaceNode( oldLocation );
            if ( oldMapSpaceNode == null )
                return false;

            MapSpaceNode newMapSpaceNode = GetSpaceNode( baseCreature.Location );
            if ( newMapSpaceNode == null )
                return false;

            if ( oldMapSpaceNode != newMapSpaceNode )
            {
                oldMapSpaceNode.OnLeave( baseCreature );
                baseCreature.MapSpaceNode = null;

                newMapSpaceNode.OnEnter( baseCreature );
                baseCreature.MapSpaceNode = newMapSpaceNode;
            }

            EventHandler<AfterCreatureMoveInMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterCreatureMoveInMap;
            if ( tempAfterEventArgs != null )
            {
                AfterCreatureMoveInMapEventArgs eventArgs = new AfterCreatureMoveInMapEventArgs( oldLocation, baseCreature, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }

        /// <summary>
        /// 人物移动到新的地图区域点, 并离开旧的地图区域点
        /// </summary>
        /// <param name="oldLocation"></param>
        /// <param name="m"></param>
        public bool OnMove( Point3D oldLocation, BaseCharacter baseCharacter )
        {
            EventHandler<BeforeCharacterMoveInMapEventArgs> tempBeforeEventArgs = m_ThreadEventBeforeCharacterMoveInMap;
            if ( tempBeforeEventArgs != null )
            {
                BeforeCharacterMoveInMapEventArgs eventArgs = new BeforeCharacterMoveInMapEventArgs( oldLocation, baseCharacter, this );
                tempBeforeEventArgs( this, eventArgs );

                if ( eventArgs.IsCancel == true )
                    return false;
            }

            MapSpaceNode oldMapSpaceNode = GetSpaceNode( oldLocation );
            if ( oldMapSpaceNode == null )
                return false;

            MapSpaceNode newMapSpaceNode = GetSpaceNode( baseCharacter.Location );
            if ( newMapSpaceNode == null )
                return false;

            if ( oldMapSpaceNode != newMapSpaceNode )
            {
                oldMapSpaceNode.OnLeave( baseCharacter );
                baseCharacter.MapSpaceNode = null;

                newMapSpaceNode.OnEnter( baseCharacter );
                baseCharacter.MapSpaceNode = newMapSpaceNode;
            }

            EventHandler<AfterCharacterMoveInMapEventArgs> tempAfterEventArgs = m_ThreadEventAfterCharacterMoveInMap;
            if ( tempAfterEventArgs != null )
            {
                AfterCharacterMoveInMapEventArgs eventArgs = new AfterCharacterMoveInMapEventArgs( oldLocation, baseCharacter, this );
                tempAfterEventArgs( this, eventArgs );
            }

            return true;
        }
        #endregion

        #region zh-CHS 给出某个坐标点范围内的数据(BaseMobile/BaseItem/NetState)

        #region 给出 Items 的数据
        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<ItemT> GetItemsInRange<ItemT>( Point3D point3D, int iRange ) where ItemT : BaseItem
        {
            return GetItemsInRange<ItemT>( point3D.X, point3D.Y, point3D.Z, iRange );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<ItemT> GetItemsInRange<ItemT>( IPoint3D point3D, int iRange ) where ItemT : BaseItem
        {
            return GetItemsInRange<ItemT>( point3D.X, point3D.Y, point3D.Z, iRange );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<ItemT> GetItemsInRange<ItemT>( float x, float y, float z, int iRange ) where ItemT : BaseItem
        {
            MapSpaceNode[] mapSpaceNodeArray = this.GetSpaceNodesInRange( x, y, z, iRange );
            if ( mapSpaceNodeArray == null )
                return NullEnumerable<ItemT>.Instance;

            List<BaseItem[]> itemArrayList = new List<BaseItem[]>( LIST_CAPACITY_SIZE );

            foreach(MapSpaceNode MapSpaceNode in mapSpaceNodeArray)
                itemArrayList.Add( MapSpaceNode.ItemsToArray() );

            return MapEnumerable<ItemT>.Instantiate( ItemEnumerator<ItemT>.Instantiate( itemArrayList ) );
        }
        #endregion

        #region 给出 Creatures 的数据
        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<CreatureT> GetCreaturesInRange<CreatureT>( Point3D point3D, int iRange ) where CreatureT : BaseCreature
        {
            return GetCreaturesInRange<CreatureT>( point3D.X, point3D.Y, point3D.Z, iRange );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<CreatureT> GetCreaturesInRange<CreatureT>( IPoint3D point3D, int iRange ) where CreatureT : BaseCreature
        {
            return GetCreaturesInRange<CreatureT>( point3D.X, point3D.Y, point3D.Z, iRange );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<CreatureT> GetCreaturesInRange<CreatureT>( float x, float y, float z, int iRange ) where CreatureT : BaseCreature
        {
            MapSpaceNode[] mapSpaceNodeArray = this.GetSpaceNodesInRange( x, y, z, iRange );
            if ( mapSpaceNodeArray == null )
                return NullEnumerable<CreatureT>.Instance;

            List<BaseCreature[]> creatureArrayList = new List<BaseCreature[]>( LIST_CAPACITY_SIZE );

            foreach ( MapSpaceNode MapSpaceNode in mapSpaceNodeArray )
                creatureArrayList.Add( MapSpaceNode.CreaturesToArray() );

            return MapEnumerable<CreatureT>.Instantiate( CreatureEnumerator<CreatureT>.Instantiate( creatureArrayList ) );
        }
        #endregion

        #region 给出 Players 的数据
        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<CharacterT> GetPlayersInRange<CharacterT>( Point3D point3D, int iRange ) where CharacterT : BaseCharacter
        {
            return GetPlayersInRange<CharacterT>( point3D.X, point3D.Y, point3D.Z, iRange );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<CharacterT> GetPlayersInRange<CharacterT>( IPoint3D point3D, int iRange ) where CharacterT : BaseCharacter
        {
            return GetPlayersInRange<CharacterT>( point3D.X, point3D.Y, point3D.Z, iRange );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public IEnumerable<CharacterT> GetPlayersInRange<CharacterT>( float x, float y, float z, int iRange ) where CharacterT : BaseCharacter
        {
            MapSpaceNode[] mapSpaceNodeArray = this.GetSpaceNodesInRange( x, y, z, iRange );
            if ( mapSpaceNodeArray == null )
                return NullEnumerable<CharacterT>.Instance;

            List<BaseCharacter[]> characterArrayList = new List<BaseCharacter[]>( LIST_CAPACITY_SIZE );

            foreach ( MapSpaceNode MapSpaceNode in mapSpaceNodeArray )
                characterArrayList.Add( MapSpaceNode.PlayersToArray() );

            return MapEnumerable<CharacterT>.Instantiate( CharacterEnumerator<CharacterT>.Instantiate( characterArrayList ) );
        }
        #endregion

        #endregion

        #region zh-CHS 激活/无效地图区域点 | en
        /// <summary>
        /// 激活地图区域点内的BaseItem或BaseMobile,当有新的玩家加入的时候会激活,表示怪物可以攻击了,没有玩家的时候可以不用动了.
        /// </summary>
        /// <param name="cx">范围点x</param>
        /// <param name="cy">范围点y</param>
        public virtual void OnActivateSpaceNode( MapSpaceNode mapSpaceNode )
        {
            EventHandler<ActivateSpaceNodeOnMapEventArgs> tempEventArgs = m_ThreadEventActivateSpaceNode;
            if ( tempEventArgs != null )
            {
                ActivateSpaceNodeOnMapEventArgs eventArgs = new ActivateSpaceNodeOnMapEventArgs( mapSpaceNode, this );
                tempEventArgs( this, eventArgs );
            }
        }

        /// <summary>
        /// 无效地图区域点内的BaseItem或BaseMobile
        /// </summary>
        /// <param name="cx">范围点x</param>
        /// <param name="cy">范围点y</param>
        public virtual void OnDeactivateSpaceNode( MapSpaceNode mapSpaceNode )
        {
            EventHandler<DeactivateSpaceNodeOnMapEventArgs> tempEventArgs = m_ThreadEventDeactivateSpaceNode;
            if ( tempEventArgs != null )
            {
                DeactivateSpaceNodeOnMapEventArgs eventArgs = new DeactivateSpaceNodeOnMapEventArgs( mapSpaceNode, this );
                tempEventArgs( this, eventArgs );
            }
        }
        #endregion

        #region zh-CHS 在区域内的某个坐标点是否可刷怪 | en
        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <returns></returns>
        public bool CanSpawn( Point3D point3D )
        {
            return CanSpawn( point3D.X, point3D.Y, point3D.Z );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point3D"></param>
        /// <returns></returns>
        public bool CanSpawn( IPoint3D point3D )
        {
            return CanSpawn( point3D.X, point3D.Y, point3D.Z );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point2D"></param>
        /// <param name="z"></param>
        /// <returns></returns>
        public bool CanSpawn( Point2D point2D, float z )
        {
            return CanSpawn( point2D.X, point2D.Y, z );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="point2D"></param>
        /// <param name="z"></param>
        /// <returns></returns>
        public bool CanSpawn( IPoint2D point2D, float z )
        {
            return CanSpawn( point2D.X, point2D.Y, z );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        /// <returns></returns>
        public bool CanSpawn( float x, float y, float z )
        {
            EventHandler<CanSpawnEventArgs> tempEventArgs = m_ThreadEventCanSpawn;
            if ( tempEventArgs != null )
            {
                CanSpawnEventArgs eventArgs = new CanSpawnEventArgs( x, y, z, this );
                tempEventArgs( this, eventArgs );

                return eventArgs.IsCanSpawn;
            }

            return true;
        }
        #endregion

        #region zh-CHS 地图区域点是否有玩家存在 | en
        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool PlayersInRange( Point2D point2D, float fRange )
        {
            return PlayersInRange( point2D.X, point2D.Y, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool PlayersInRange( IPoint2D point2D, float fRange )
        {
            return PlayersInRange( point2D.X, point2D.Y, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool PlayersInRange( float x, float y, float fRange )
        {
            return PlayersInRange( x, y, 0, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool PlayersInRange( Point3D point3D, float fRange )
        {
            return PlayersInRange( point3D.X, point3D.Y, point3D.Z, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool PlayersInRange( IPoint3D point3D, float fRange )
        {
            return PlayersInRange( point3D.X, point3D.Y, point3D.Z, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool PlayersInRange( float x, float y, float z, float fRange )
        {
            EventHandler<PlayersInRangeEventArgs> tempEventArgs = m_ThreadEventPlayersInRange;
            if ( tempEventArgs != null )
            {
                PlayersInRangeEventArgs eventArgs = new PlayersInRangeEventArgs( x, y, z, fRange, this );
                tempEventArgs( this, eventArgs );

                return eventArgs.IsPlayersInRange;
            }

            return false;
        }
        #endregion

        #region zh-CHS 地图区域点是否有人物存在 | en
        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool CreaturesInRange( Point2D point2D, float fRange )
        {
            return CreaturesInRange( point2D.X, point2D.Y, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool CreaturesInRange( IPoint2D point2D, float fRange )
        {
            return CreaturesInRange( point2D.X, point2D.Y, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool CreaturesInRange( float x, float y, float fRange )
        {
            return CreaturesInRange( x, y, 0, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool CreaturesInRange( Point3D point3D, float fRange )
        {
            return CreaturesInRange( point3D.X, point3D.Y, point3D.Z, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool CreaturesInRange( IPoint3D point3D, float fRange )
        {
            return CreaturesInRange( point3D.X, point3D.Y, point3D.Z, fRange );
        }

        /// <summary>
        /// 检查某个区域内是否有玩家存在
        /// </summary>
        /// <param name="sector"></param>
        /// <param name="iRange"></param>
        /// <returns></returns>
        public bool CreaturesInRange( float x, float y, float z, float fRange )
        {
            EventHandler<CreaturesInRangeEventArgs> tempEventArgs = m_ThreadEventCreaturesInRange;
            if ( tempEventArgs != null )
            {
                CreaturesInRangeEventArgs eventArgs = new CreaturesInRangeEventArgs( x, y, z, fRange, this );
                tempEventArgs( this, eventArgs );

                return eventArgs.IsCreaturesInRange;
            }

            return false;
        }
        #endregion

        #region zh-CHS 确保坐标点在地图的边界内 | en
        /// <summary>
        /// 确保Point2D坐标点在地图的边界内
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public Point2D Bound( Point2D point2D )
        {
            return Bound( point2D.X, point2D.Y );
        }

        /// <summary>
        /// 确保Point2D坐标点在地图的边界内
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public Point2D Bound( IPoint2D point2D )
        {
            return Bound( point2D.X, point2D.Y );
        }

        /// <summary>
        /// 确保x,y在地图的边界内
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="newX"></param>
        /// <param name="newY"></param>
        public Point2D Bound( float x, float y )
        {
            float newX = 0;
            float newY = 0;

            if ( x < m_MapRectangle.Start.X )
                newX = m_MapRectangle.Start.X;
            else if ( x > m_MapRectangle.End.X )
                newX = m_MapRectangle.End.X;
            else
                newX = x;

            if ( y < m_MapRectangle.Start.Y )
                newY = m_MapRectangle.Start.Y;
            else if ( y > m_MapRectangle.End.Y )
                newY = m_MapRectangle.End.Y;
            else
                newY = y;

            return new Point2D( newX, newY );
        }

        /// <summary>
        /// 确保Point3D坐标点在地图的边界内
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public Point3D Bound( Point3D point3D )
        {
            return Bound( point3D.X, point3D.Y, point3D.Z );
        }

        /// <summary>
        /// 确保Point3D坐标点在地图的边界内
        /// </summary>
        /// <param name="point2D"></param>
        /// <returns></returns>
        public Point3D Bound( IPoint3D point3D )
        {
            return Bound( point3D.X, point3D.Y, point3D.Z );
        }

        /// <summary>
        /// 确保x,y,z在地图的边界内
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="newX"></param>
        /// <param name="newY"></param>
        public Point3D Bound( float x, float y, float z )
        {
            float newX = 0;
            float newY = 0;
            float newZ = 0;

            if ( x < m_MapRectangle.Start.X )
                newX = m_MapRectangle.Start.X;
            else if ( x > m_MapRectangle.End.X )
                newX = m_MapRectangle.End.X;
            else
                newX = x;

            if ( y < m_MapRectangle.Start.Y )
                newY = m_MapRectangle.Start.Y;
            else if ( y > m_MapRectangle.End.Y )
                newY = m_MapRectangle.End.Y;
            else
                newY = y;

            if ( z < m_MapRectangle.Start.Z )
                newZ = m_MapRectangle.Start.Z;
            else if ( z > m_MapRectangle.End.Z )
                newZ = m_MapRectangle.End.Z;
            else
                newZ = z;

            return new Point3D( newX, newY, newZ );
        }
        #endregion

        #region zh-CHS 地图的主处理行为 | en
        /// <summary>
        /// 
        /// </summary>
        public virtual void ProcessSlice()
        {
            EventHandler<MapEventArgs> tempEventArgs = m_ThreadEventSlice;
            if ( tempEventArgs != null )
            {
                MapEventArgs eventArgs = new MapEventArgs( this );
                tempEventArgs( this, eventArgs );
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public static void UpdateSliceTo<thisT>( IUpdateSlice<thisT> updateSlice, thisT mapT ) where thisT : BaseMap
        {
            if ( updateSlice == null )
            {
                Debug.WriteLine( "BaseMap.Slice(...) - updateSlice == null error!" );
                return;
            }

            if ( mapT == null )
            {
                Debug.WriteLine( "BaseMap.Slice(...) - mapT == null error!" );
                return;
            }

            updateSlice.UpdateSlice( mapT );

            BaseWorld tempBaseWorld = mapT.BaseWorld;
            if ( tempBaseWorld != null )
                tempBaseWorld.SetWorldSignal();
            else
                Debug.WriteLine( "BaseMap.Slice(...) - tempBaseWorld == null error!" );
        }
        #endregion

        #endregion

        #region zh-CHS 方法覆盖 | en Override Methods
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return m_MapName;
        }
        #endregion

        #region zh-CHS 接口实现 | en Interface Implementation
        /// <summary>
        /// 
        /// </summary>
        /// <param name="otherBaseMap"></param>
        /// <returns></returns>
        public int CompareTo( BaseMap otherBaseMap )
        {
            if ( otherBaseMap == null )
                return 1;

            return m_MapId.CompareTo( otherBaseMap.m_MapId );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="xObject"></param>
        /// <returns></returns>
        public int CompareTo( object xObject )
        {
            return CompareTo( xObject as BaseMap );
        }

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private SliceSupport m_SliceSupport = new SliceSupport();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public bool InSliceQueue()
        {
            return m_SliceSupport.InSliceQueue();
        }

        /// <summary>
        /// 
        /// </summary>
        public void OutSliceQueue()
        {
            m_SliceSupport.OutSliceQueue();
        }
        #endregion

        #region zh-CHS 私有事件 | en Private Event

        #region zh-CHS PartitionSpace事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<PartitionSpaceEventArgs> m_ThreadEventPartitionSpace;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventPartitionSpace = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        private event EventHandler<PartitionSpaceEventArgs> ThreadPartitionSpace
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventPartitionSpace );
                {
                    m_ThreadEventPartitionSpace += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventPartitionSpace );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventPartitionSpace );
                {
                    m_ThreadEventPartitionSpace -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventPartitionSpace );
            }
        }
        #endregion

        #region zh-CHS GetSpaceNode事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<GetSpaceNodeEventArgs> m_ThreadEventGetSpaceNode;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventGetSpaceNode = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        private event EventHandler<GetSpaceNodeEventArgs> ThreadGetSpaceNode
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventGetSpaceNode );
                {
                    m_ThreadEventGetSpaceNode += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventGetSpaceNode );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventGetSpaceNode );
                {
                    m_ThreadEventGetSpaceNode -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventGetSpaceNode );
            }
        }
        #endregion

        #region zh-CHS GetGetSpaceNodesInRange事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<GetGetSpaceNodesInRangeEventArgs> m_ThreadEventGetSpaceNodesInRange;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventGetSpaceNodesInRange = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        private event EventHandler<GetGetSpaceNodesInRangeEventArgs> ThreadGetSpaceNodesInRange
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventGetSpaceNodesInRange );
                {
                    m_ThreadEventGetSpaceNodesInRange += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventGetSpaceNodesInRange );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventGetSpaceNodesInRange );
                {
                    m_ThreadEventGetSpaceNodesInRange -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventGetSpaceNodesInRange );
            }
        }
        #endregion

        #region zh-CHS ActivateMapSpaceNode事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<ActivateSpaceNodeOnMapEventArgs> m_ThreadEventActivateSpaceNode;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventActivateSpaceNode = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        private event EventHandler<ActivateSpaceNodeOnMapEventArgs> ThreadActivateSpaceNode
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventActivateSpaceNode );
                {
                    m_ThreadEventActivateSpaceNode += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventActivateSpaceNode );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventActivateSpaceNode );
                {
                    m_ThreadEventActivateSpaceNode -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventActivateSpaceNode );
            }
        }
        #endregion

        #region zh-CHS DeactivateMapSpaceNode事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<DeactivateSpaceNodeOnMapEventArgs> m_ThreadEventDeactivateSpaceNode;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventDeactivateSpaceNode = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        private event EventHandler<DeactivateSpaceNodeOnMapEventArgs> ThreadDeactivateSpaceNode
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventDeactivateSpaceNode );
                {
                    m_ThreadEventDeactivateSpaceNode += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventDeactivateSpaceNode );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventDeactivateSpaceNode );
                {
                    m_ThreadEventDeactivateSpaceNode -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventDeactivateSpaceNode );
            }
        }
        #endregion

        #endregion

        #region zh-CHS 共有事件 | en Public Event

        #region zh-CHS CanSpawn事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<CanSpawnEventArgs> m_ThreadEventCanSpawn;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventCanSpawn = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<CanSpawnEventArgs> ThreadCanSpawn
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventCanSpawn );
                {
                    m_ThreadEventCanSpawn += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventCanSpawn );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventCanSpawn );
                {
                    m_ThreadEventCanSpawn -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventCanSpawn );
            }
        }
        #endregion

        #region zh-CHS PlayersInRange事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<PlayersInRangeEventArgs> m_ThreadEventPlayersInRange;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventPlayersInRange = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<PlayersInRangeEventArgs> ThreadPlayersInRange
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventPlayersInRange );
                {
                    m_ThreadEventPlayersInRange += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventPlayersInRange );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventPlayersInRange );
                {
                    m_ThreadEventPlayersInRange -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventPlayersInRange );
            }
        }
        #endregion

        #region zh-CHS CreatureInRange事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<CreaturesInRangeEventArgs> m_ThreadEventCreaturesInRange;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventCreaturesInRange = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<CreaturesInRangeEventArgs> ThreadCreaturesInRange
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventCreaturesInRange );
                {
                    m_ThreadEventCreaturesInRange += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventCreaturesInRange );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventCreaturesInRange );
                {
                    m_ThreadEventCreaturesInRange -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventCreaturesInRange );
            }
        }
        #endregion

        #region zh-CHS Slice事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<MapEventArgs> m_ThreadEventSlice;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventSlice = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<MapEventArgs> ThreadSlice
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventSlice );
                {
                    m_ThreadEventSlice += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventSlice );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventSlice );
                {
                    m_ThreadEventSlice -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventSlice );
            }
        }
        #endregion

        #region zh-CHS BeforeItemEnterMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeItemEnterMapEventArgs> m_ThreadEventBeforeItemEnterMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeItemEnterMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeItemEnterMapEventArgs> ThreadBeforeItemEnterMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeItemEnterMap );
                {
                    m_ThreadEventBeforeItemEnterMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeItemEnterMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeItemEnterMap );
                {
                    m_ThreadEventBeforeItemEnterMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeItemEnterMap );
            }
        }
        #endregion

        #region zh-CHS AfterItemEnterMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterItemEnterMapEventArgs> m_ThreadEventAfterItemEnterMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterItemEnterMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterItemEnterMapEventArgs> ThreadAfterItemEnterMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterItemEnterMap );
                {
                    m_ThreadEventAfterItemEnterMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterItemEnterMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterItemEnterMap );
                {
                    m_ThreadEventAfterItemEnterMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterItemEnterMap );
            }
        }
        #endregion

        #region zh-CHS BeforeItemLeaveMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeItemLeaveMapEventArgs> m_ThreadEventBeforeItemLeaveMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeItemLeaveMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeItemLeaveMapEventArgs> ThreadBeforeItemLeaveMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeItemLeaveMap );
                {
                    m_ThreadEventBeforeItemLeaveMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeItemLeaveMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeItemLeaveMap );
                {
                    m_ThreadEventBeforeItemLeaveMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeItemLeaveMap );
            }
        }
        #endregion

        #region zh-CHS AfterItemLeaveMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterItemLeaveMapEventArgs> m_ThreadEventAfterItemLeaveMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterItemLeaveMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterItemLeaveMapEventArgs> ThreadAfterItemLeaveMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterItemLeaveMap );
                {
                    m_ThreadEventAfterItemLeaveMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterItemLeaveMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterItemLeaveMap );
                {
                    m_ThreadEventAfterItemLeaveMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterItemLeaveMap );
            }
        }
        #endregion

        #region zh-CHS BeforeItemMoveInMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeItemMoveInMapEventArgs> m_ThreadEventBeforeItemMoveInMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeItemMoveInMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeItemMoveInMapEventArgs> ThreadBeforeItemMoveInMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeItemMoveInMap );
                {
                    m_ThreadEventBeforeItemMoveInMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeItemMoveInMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeItemMoveInMap );
                {
                    m_ThreadEventBeforeItemMoveInMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeItemMoveInMap );
            }
        }
        #endregion

        #region zh-CHS AfterItemMoveInMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterItemMoveInMapEventArgs> m_ThreadEventAfterItemMoveInMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterItemMoveInMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterItemMoveInMapEventArgs> ThreadAfterItemMoveInMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterItemMoveInMap );
                {
                    m_ThreadEventAfterItemMoveInMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterItemMoveInMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterItemMoveInMap );
                {
                    m_ThreadEventAfterItemMoveInMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterItemMoveInMap );
            }
        }
        #endregion

        #region zh-CHS BeforeCreatureEnterMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeCreatureEnterMapEventArgs> m_ThreadEventBeforeCreatureEnterMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeCreatureEnterMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeCreatureEnterMapEventArgs> ThreadBeforeCreatureEnterMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCreatureEnterMap );
                {
                    m_ThreadEventBeforeCreatureEnterMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCreatureEnterMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCreatureEnterMap );
                {
                    m_ThreadEventBeforeCreatureEnterMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCreatureEnterMap );
            }
        }
        #endregion

        #region zh-CHS AfterCreatureEnterMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterCreatureEnterMapEventArgs> m_ThreadEventAfterCreatureEnterMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterCreatureEnterMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterCreatureEnterMapEventArgs> ThreadAfterCreatureEnterMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCreatureEnterMap );
                {
                    m_ThreadEventAfterCreatureEnterMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCreatureEnterMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCreatureEnterMap );
                {
                    m_ThreadEventAfterCreatureEnterMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCreatureEnterMap );
            }
        }
        #endregion

        #region zh-CHS BeforeCreatureLeaveMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeCreatureLeaveMapEventArgs> m_ThreadEventBeforeCreatureLeaveMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeCreatureLeaveMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeCreatureLeaveMapEventArgs> ThreadBeforeCreatureLeaveMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCreatureLeaveMap );
                {
                    m_ThreadEventBeforeCreatureLeaveMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCreatureLeaveMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCreatureLeaveMap );
                {
                    m_ThreadEventBeforeCreatureLeaveMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCreatureLeaveMap );
            }
        }
        #endregion

        #region zh-CHS AfterCreatureLeaveMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterCreatureLeaveMapEventArgs> m_ThreadEventAfterCreatureLeaveMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterCreatureLeaveMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterCreatureLeaveMapEventArgs> ThreadAfterCreatureLeaveMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCreatureLeaveMap );
                {
                    m_ThreadEventAfterCreatureLeaveMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCreatureLeaveMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCreatureLeaveMap );
                {
                    m_ThreadEventAfterCreatureLeaveMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCreatureLeaveMap );
            }
        }
        #endregion

        #region zh-CHS BeforeCreatureMoveInMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeCreatureMoveInMapEventArgs> m_ThreadEventBeforeCreatureMoveInMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeCreatureMoveInMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeCreatureMoveInMapEventArgs> ThreadBeforeCreatureMoveInMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCreatureMoveInMap );
                {
                    m_ThreadEventBeforeCreatureMoveInMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCreatureMoveInMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCreatureMoveInMap );
                {
                    m_ThreadEventBeforeCreatureMoveInMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCreatureMoveInMap );
            }
        }
        #endregion

        #region zh-CHS AfterCreatureMoveInMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterCreatureMoveInMapEventArgs> m_ThreadEventAfterCreatureMoveInMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterCreatureMoveInMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterCreatureMoveInMapEventArgs> ThreadAfterCreatureMoveInMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCreatureMoveInMap );
                {
                    m_ThreadEventAfterCreatureMoveInMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCreatureMoveInMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCreatureMoveInMap );
                {
                    m_ThreadEventAfterCreatureMoveInMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCreatureMoveInMap );
            }
        }
        #endregion

        #region zh-CHS BeforeCharacterEnterMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeCharacterEnterMapEventArgs> m_ThreadEventBeforeCharacterEnterMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeCharacterEnterMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeCharacterEnterMapEventArgs> ThreadBeforeCharacterEnterMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCharacterEnterMap );
                {
                    m_ThreadEventBeforeCharacterEnterMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCharacterEnterMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCharacterEnterMap );
                {
                    m_ThreadEventBeforeCharacterEnterMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCharacterEnterMap );
            }
        }
        #endregion

        #region zh-CHS AfterCharacterEnterMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterCharacterEnterMapEventArgs> m_ThreadEventAfterCharacterEnterMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterCharacterEnterMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterCharacterEnterMapEventArgs> ThreadAfterCharacterEnterMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCharacterEnterMap );
                {
                    m_ThreadEventAfterCharacterEnterMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCharacterEnterMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCharacterEnterMap );
                {
                    m_ThreadEventAfterCharacterEnterMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCharacterEnterMap );
            }
        }
        #endregion

        #region zh-CHS BeforeCharacterLeaveMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeCharacterLeaveMapEventArgs> m_ThreadEventBeforeCharacterLeaveMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeCharacterLeaveMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeCharacterLeaveMapEventArgs> ThreadBeforeCharacterLeaveMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCharacterLeaveMap );
                {
                    m_ThreadEventBeforeCharacterLeaveMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCharacterLeaveMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCharacterLeaveMap );
                {
                    m_ThreadEventBeforeCharacterLeaveMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCharacterLeaveMap );
            }
        }
        #endregion

        #region zh-CHS AfterCharacterLeaveMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterCharacterLeaveMapEventArgs> m_ThreadEventAfterCharacterLeaveMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterCharacterLeaveMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterCharacterLeaveMapEventArgs> ThreadAfterCharacterLeaveMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCharacterLeaveMap );
                {
                    m_ThreadEventAfterCharacterLeaveMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCharacterLeaveMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCharacterLeaveMap );
                {
                    m_ThreadEventAfterCharacterLeaveMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCharacterLeaveMap );
            }
        }
        #endregion

        #region zh-CHS BeforeCharacterMoveInMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<BeforeCharacterMoveInMapEventArgs> m_ThreadEventBeforeCharacterMoveInMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventBeforeCharacterMoveInMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<BeforeCharacterMoveInMapEventArgs> ThreadBeforeCharacterMoveInMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCharacterMoveInMap );
                {
                    m_ThreadEventBeforeCharacterMoveInMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCharacterMoveInMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventBeforeCharacterMoveInMap );
                {
                    m_ThreadEventBeforeCharacterMoveInMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventBeforeCharacterMoveInMap );
            }
        }
        #endregion

        #region zh-CHS AfterCharacterMoveInMap事件 | en Public Event
        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private EventHandler<AfterCharacterMoveInMapEventArgs> m_ThreadEventAfterCharacterMoveInMap;
        /// <summary>
        /// 
        /// </summary>
        private ReaderWriterLockSlim m_LockThreadEventAfterCharacterMoveInMap = new ReaderWriterLockSlim();
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public event EventHandler<AfterCharacterMoveInMapEventArgs> ThreadAfterCharacterMoveInMap
        {
            add
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCharacterMoveInMap );
                {
                    m_ThreadEventAfterCharacterMoveInMap += value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCharacterMoveInMap );
            }
            remove
            {
                ReaderWriterLockSlimEx.EnterWriteLock( m_LockThreadEventAfterCharacterMoveInMap );
                {
                    m_ThreadEventAfterCharacterMoveInMap -= value;
                }
                ReaderWriterLockSlimEx.ExitWriteLock( m_LockThreadEventAfterCharacterMoveInMap );
            }
        }
        #endregion

        #endregion
    }
}
#endregion

